Repository navigation
refactor: extract requests transport - #469
Merged
Merged
Conversation
for more information, see https://pre-commit.ci
alexanto
requested review from
ppicom
and
a balanced review from Copilot
and removed request for
Copilot
November 5, 2026 13:27
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Transport-contract gaps break ETag caching, raise unexpectedly after retry exhaustion, corrupt non-UTF-8 feature data, and allow injected network failures to bypass metric restoration or abort initialization.
4 open issues
What changed in this PR
Extracts HTTP I/O from the synchronous API client into a transport layer, preparing the SDK for custom transports while keeping RequestsTransport as the default.
Changes:
- Adds request and response models, a transport protocol, and a requests-based implementation.
- Routes feature fetching, registration, and metrics submission through the transport.
- Adds tests for transport injection, request handling, retries, and session isolation.
| File | Description |
|---|---|
UnleashClient/_unleash_api_client.py |
Delegates HTTP calls to an injectable transport and interprets its responses. |
UnleashClient/_transport.py |
Defines transport interfaces and the default requests implementation. |
tests/unit_tests/test_unleash_api_client.py |
Tests transport delegation for all three API operations. |
tests/unit_tests/test_transport.py |
Tests request forwarding, responses, retries, errors, and session isolation. |
Review effort: Balanced
sighphyre
approved these changes
Nov 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

extracting the i/o from the api_client as transport. this is the first step towards a custom HTTP transport.
so far really just refactoring, and RequestsTransport is going to be the default transport implementation for the sync client